package com.ruoyi.wxb.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.helper.LoginHelper;
import com.ruoyi.wxb.domain.WxConfig;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequiredArgsConstructor
@RestController
@RequestMapping("/Test")
public class TestController {

    private final WxConfig wxConfig;

    /** 测试 热更新 */
    @SaIgnore
    @GetMapping("/A")
    public R<Void> test() {
        return R.ok("测试12");
    }

    /** 获取YML中配置*/
    @SaIgnore
    @GetMapping("/B")
    public R<WxConfig> test2() {
        return R.ok("获取YML中配置", wxConfig);
    }

    /** 获取YML中配置*/
    @GetMapping("/C")
    public R<LoginUser> test3() {
        LoginUser loginUser = LoginHelper.getLoginUser();
        return R.ok("获取用户", loginUser);
    }

}
